package com.link2room.aeriabots.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by LN on 2016/9/1.
 */
@Entity
@Table(name = "wx_component")
@DynamicInsert
public class WxComponent extends BaseEntity{
    public enum WxComponent_{
        item,value,descript
    }
    private String item;
    private String value;
    private String descript;

    @Basic
    @Column(name = "item", nullable = false, length = 30)
    public String getItem() {
        return item;
    }

    public void setItem(String item) {
        this.item = item;
    }

    @Basic
    @Column(name = "value", nullable = false, length = 255)
    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    @Basic
    @Column(name = "descript", nullable = false, length = 100)
    public String getDescript() {
        return descript;
    }

    public void setDescript(String descript) {
        this.descript = descript;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        WxComponent that = (WxComponent) o;

        if (item != null ? !item.equals(that.item) : that.item != null) return false;
        if (value != null ? !value.equals(that.value) : that.value != null) return false;
        if (descript != null ? !descript.equals(that.descript) : that.descript != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = item != null ? item.hashCode() : 0;
        result = 31 * result + (value != null ? value.hashCode() : 0);
        result = 31 * result + (descript != null ? descript.hashCode() : 0);
        return result;
    }
}
